package fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

/**
 * Created by asus on 2016/11/1.
 */
public class MainFragment1 extends Fragment{
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        TextView textview = new TextView(getActivity());
        textview.setText(getArguments().getString("title"));

        return textview;
    }
    public static Fragment getInstance(String title){
        MainFragment1 fragment1 = new MainFragment1();
        Bundle bundle = new Bundle();
        bundle.putString("title",title);
        fragment1.setArguments(bundle);
        return fragment1;
    }
}
